// GNU (L)GPLv3+ here.

#include "MaxsiGameEngine.h"

#define MAXSI_DRAW_LIST_SIZE (16*1024)

struct MaxsiDrawList
{
	BYTE* Data;
	size_t DataSize;
	size_t DataUsed;
};

MaxsiDrawList*	DrawLists					=	NULL;
MaxsiHandle		DrawListsLock				=	NULL;
size_t			DrawListsNum				=	0;
size_t			RenderingThreadPointer		=	0;
size_t			ThreadPointerFront			=	0;
size_t			ThreadPointerBack			=	0;

MaxsiError InitializeDrawLists()
{
	if ( DrawLists != NULL ) { return MAXSI_ERROR_ALREADY_INITIALIZED; }

	DrawListsNum	=	GetNumWorkerThreads();

	if ( DrawListsNum == 0 ) { return MAXSI_ERROR_UNSPECIFIED; }

	DrawLists		=	new MaxsiDrawList[3*DrawListsNum];

	if ( DrawLists == NULL ) { return MAXSI_ERROR_MEM_ALLOC_FAIL; }

	
	

	return MAXSI_ERROR_SUCCESS;
}
